<script>
const p = new Promise(function(resolve, reject) {
  // resolve('20升水')
  // reject('水有毒')
  // resolve('污染源被清除了')
  if(Math.random() < 0.5) {
    resolve('a')
  } else {
    reject('b')
  }
})
console.log(p)

new Promise((_, reject) => reject("失败"))
  .then(undefined, (reason) => console.log(reason))
</script>